home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / ARRAYTXT.HDR < prev    next >
Text File  |  1994-04-25  |  3KB  |  103 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _ArrayText( acArray, cFile, nWidth, lAppend ) --> nElementsWritten
  8.  
  9. PARAMETERS:
  10.  
  11. acArray : Single Dimension Array to be written to text file
  12. cFile   : File to write/append to
  13. nWidth  : Maximum width of elements to write (DEFAULT 1024)
  14. lAppend : FALSE = Replace File
  15.           TRUE  = Append to File
  16.  
  17. SHORT:
  18.  
  19. Write an array to a text file.
  20.  
  21. DESCRIPTION:
  22.  
  23. _ArrayText() is the opposite of _TextArray().  It takes an array and writes
  24. it to a disk file.
  25.  
  26. The array need not be exclusively composed of character elements.
  27. All non-character elements are converted to character type.  All
  28. elements converted to string are "alltrim()ed".  Logical values become "Y"
  29. or "N" in the output file.
  30.  
  31. if nWidth is specified, then only the first nWidth characters of the
  32. element (after stringifying for non-char types) is written to each line in
  33. the output file.  If nWidth is not specified, then the entire array
  34. element, up to 1024 characters, is written.
  35.  
  36. If lAppend is TRUE, the array is added to the bottom of the output file if
  37. it exists.  If lAppend is FALSE, then the output file is overwritten.
  38.  
  39. Unlike _TextArray(), _ArrayText() must be supplied with the name of a
  40. file that is !NOT OPEN!
  41.  
  42. _ArrayText() returns the number of array elements written.
  43.  
  44. NOTE:
  45.  
  46.  
  47.  
  48. EXAMPLE:
  49.  
  50. LOCAL acArray := {}
  51. acArray = _TextArray('AUTOEXEC.BAT')
  52.  
  53. aadd(acArray,'SET U_NAME=KWALLACE')
  54.  
  55. _ArrayText(acArray, 'AUTOEXEC.BAT')
  56.  
  57. Result: AUTOEXEC.BAT is replaced with a copy of the original with
  58. an additional line (SET U_NAME=KWALLAC) added.
  59.  
  60. AUTOEXEC.BAT BEFORE:
  61.  
  62. @ECHO OFF
  63. PROMPT $P$G
  64. PATH=C:\DOS
  65. C:\C600\BINB
  66. C:\C600\BIN
  67. C:\UT
  68. C:\CLIPPER5\BIN
  69. lh \dos\doskey
  70. SET CLIPPER=F95
  71. E00
  72. SET OBJ=C:\CLIPPER5\OBJ
  73. SET PLL=C:\CLIPPER5\INCLUDE
  74. SET LIB=C:\C600\LIB
  75. C:\CLIPPER5\LIB
  76. SET INCLUDE=C:\C600\INCLUDE
  77. C:\CLIPPER5\INCLUDE
  78. c:\apps\clip_inc
  79.  
  80. AUTOEXEC.BAT AFTER:
  81.  
  82.  
  83. @ECHO OFF
  84. PROMPT $P$G
  85. PATH=C:\DOS
  86. C:\C600\BINB
  87. C:\C600\BIN
  88. C:\UT
  89. C:\CLIPPER5\BIN
  90. lh \dos\doskey
  91. SET CLIPPER=F95
  92. E00
  93. SET OBJ=C:\CLIPPER5\OBJ
  94. SET PLL=C:\CLIPPER5\INCLUDE
  95. SET LIB=C:\C600\LIB
  96. C:\CLIPPER5\LIB
  97. SET INCLUDE=C:\C600\INCLUDE
  98. C:\CLIPPER5\INCLUDE
  99. c:\apps\clip_inc
  100. SET U_NAME=KWALLACE
  101.  
  102. ******************************************************************************/
  103.